package com.cloud.exception;


import java.io.Serializable;

/**
 * 校验异常
 */
public class ValidateException extends RuntimeException implements Serializable {

    private int errorCode;
    private String errorMsg;

    public ValidateException(String errorMsg) {
        this.errorCode = -1;
        this.errorMsg = errorMsg;
    }

    public ValidateException(int errorCode, String errorMsg) {
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public int getErrorCode() {
        return errorCode;
    }

    public ValidateException setErrorCode(int errorCode) {
        this.errorCode = errorCode;
        return this;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public ValidateException setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
        return this;
    }
}
